library(tidyverse)
library(randomForest)

#### Read in data with necessary data for each sample. In this tutorial the column headings must be the same as those used when the model was created.
SHdata <-read.csv('2024 Tutorial samples to use RF model files.csv')


#### Load Random Forest Model File for converting Cornell WSA method to ARS method:
load("WAS Cornell to ARS RF 12-5-2023.rda")
#Note the Model File Name in R is RFWAS


#### Use AWC Full Random Forest Model to predict AWC on samples of interest.
SHdata$WSA.ARS.predict.fromCASH = predict(RFWAS, SHdata)



#### Load Random Forest Model File for converting SLAKES WSA method to ARS method:
load("WAS SLAKES to ARS RF 12-5-2023.rda")
#Note the Model File Name in R is RFWAS2

#### Use Field Capacity Full Random Forest Model to predict field capacity on samples of interest.
SHdata$WSA.ARS.predict.fromSLAKES = predict(RFWAS2, SHdata)